package com.yupi.yupicturebackend.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yupicturebackend.model.entity.Space;
import com.yupi.yupicturebackend.model.entity.User;
import com.yupi.yupicturebackend.model.req.space.SpaceAddRequest;
import com.yupi.yupicturebackend.model.req.space.SpaceQueryRequest;
import com.yupi.yupicturebackend.model.vo.SpaceVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author 86178
* @description 针对表【space(空间)】的数据库操作Service
* @createDate 2025-04-10 16:06:35
*/
public interface SpaceService extends IService<Space> {


    /**
     * 校验空间
     * @param space
     */
    void validSpace(Space space,Boolean add);



    /**
     * 获取查询对象
     * @param spaceQueryRequest
     * @return
     */

    QueryWrapper<Space> getQueryWrapper(SpaceQueryRequest spaceQueryRequest);


    /**
     * 获取空间VO
     * @param space
     * @param request
     * @return
     */
    SpaceVO getSpaceVO(Space space, HttpServletRequest request);


    /**
     * 分页获取空间封装
     * @param spacePage
     * @param request
     * @return
     */
    Page<SpaceVO> getSpaceVOPage(Page<Space> spacePage, HttpServletRequest request);


    /**
     * 根据空间等级填充空间的参数
     * @param space
     */
    void fillSpaceBySpaceLevel(Space space);


    /**
     * 添加空间
     * @param spaceAddRequest
     * @param loginUser
     * @return
     */
    long addSpace(SpaceAddRequest spaceAddRequest , User loginUser);
}
